//
//  StoreDiscussCell.m
//  LiTianDecoration
//
//  Created by zero on 2018/7/13.
//  Copyright © 2018年 administrator. All rights reserved.
//

#import "StoreDiscussCell.h"
#import "JWStarView.h"
@implementation StoreDiscussCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}
- (void)setModel:(Evaluate *)model{
    _model = model;
    
    [self addStar:model.scores];
    
    
    _label_time.text = model.addTime;
    _label_content.text = model.content;
    _label_name.text = model.memberNameFinal;
    [_img_header sd_setImageWithURL:[NSURL URLWithString:model.memberAvatarUrl]];
    
}

/**
 添加评价分数

 @param scores <#number description#>
 */
- (void)addStar:(float)scores
{
    for (UIView *view in _view_star.subviews) {
        if ([view isKindOfClass:[JWStarView class]]) {
            [view removeFromSuperview];
        }
    }
    JWStarView *star = [[JWStarView alloc]initWithFrame:CGRectMake(0, 0, 75, 15)];
    star.currentScore = scores;
    star.isIndicator = YES;
    star.rateStyle = HalfStar;
    [_view_star addSubview:star];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
